package br.com.fitness.core.infrastructure.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 
 * @author Iury Teixeira
 * 
 */
public class ApplicationContextRegister {

	private static ApplicationContext applicationContext;

	static {
		applicationContext = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
	}

	public static <T> T getBean(String beanName, Class<T> type) {
		return (T) applicationContext.getBean(beanName, type);

	}
	
	public static void main(String[] args) {
		System.out.println(applicationContext);
	}

}